package com.zy.explore.generator.interfaces.frm;

import com.zy.explore.generator.infrastructure.core.enums.FrameworkTypeEnum;
import com.zy.explore.generator.infrastructure.core.enums.PersistLayerFrameworkTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 建类说明：生成表代码请求参数Frm
 * 当前版本：1.0.0
 *
 * @author 中国印
 * @date 2022年01月15日 17:50:19
 * @since 1.0.0
 */
@ApiModel("生成表代码请求参数Frm")
@Data
@Builder
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class CustomFrm {

    @ApiModelProperty(value = "Mysql主机", example = "127.0.0.1", required = true)
    @NotBlank(message = "Mysql主机IP不能为空")
    private String mysqlHost;
    @ApiModelProperty(value = "Mysql端口", example = "3306", required = true)
    @NotBlank(message = "Mysql端口不能为空")
    private String mysqlPort;
    @ApiModelProperty(value = "Mysql用户名", example = "root", required = true)
    @NotBlank(message = "Mysql用户名不能为空")
    private String mysqlUser;
    @ApiModelProperty(value = "Mysql密码", example = "test123456", required = true)
    @NotBlank(message = "Mysql密码不能为空")
    private String mysqlPwd;
    @ApiModelProperty(value = "Mysql数据库名称", example = "mysql_test", required = true)
    @NotBlank(message = "Mysql数据库名称不能为空")
    private String mysqlDb;

    @ApiModelProperty(value = "表名集合，多个请用英文逗号分隔", example = "sys_user,sys_role", required = true)
    private List<String> tableNameList;

    @ApiModelProperty(value = "架构类型", allowableValues = "0,1", example = "DDD_FEIGN", required = true)
    @NotNull(message = "架构类型必选")
    private FrameworkTypeEnum frameworkType;

    @ApiModelProperty(value = "包路径", example = "com.zy.explore.demo", required = true)
    @NotBlank(message = "包路径不能为空")
    private String basePackageName;

    @ApiModelProperty(value = "生成代码的项目根路径，不设置则默认在当前目录的code文件夹下", example = "C:/Users/Administrator/Desktop")
    private String codeRoot;

    @ApiModelProperty(value = "项目名称", example = "ddd-demo", required = true)
    private String projectName;

    @ApiModelProperty(value = "开发者", example = "🇨🇳中国印🇨🇳")
    private String authorName;

    @ApiModelProperty(value = "要去除的表名前缀，多个请用英文逗号分隔", example = "t_")
    private String tableNamePrefix;

    @ApiModelProperty(value = "持久层框架", allowableValues = "0,1,2", example = "JPA", required = true)
    @NotNull(message = "持久层框架必选")
    private PersistLayerFrameworkTypeEnum persistLayerFrameworkType;
}
